@extends('admin.index')

@section('content')
<form action="{{ url('admin/orders')}}" method="get">
   <input type="text" placeholder="请输入搜索关键字" name="title" class="input" style="width:250px; line-height:17px;display:inline-block" />
    <input type="submit" class="button border-main icon-search" value="搜索" >
</form>
<form style='display:none;' action='/orders' method='post' name='myform'>
        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
        <input type='hidden' name='_method' value='DELETE'>
</form>
 <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th>订单号</th>
        <th>商品名称</th>
        <th>数量</th>
        <th>价格</th>
        <th>订单状态</th>
        <th>地址</th>
        <th>电话</th>
        <th width="310">操作</th>
      </tr>
        @foreach($list as $v)
        <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" />
           {{ $v->id }}</td>
          <td>{{ $v->order_num }}</td>
          <td>{{ $v->goods_name }}</td>
          <td>{{ $v->num }}</td>
          <td>{{ $v->price }}</td>
          <td>{{ ($v->order_status==2)?"已发货":"未发货"}}{{ ($v->pay_status==1)?"已付款":"未付款"}}</td>
          <td>{{ $v->city}}{{ $v->district }}{{ $v->address }}</td>
          <td>{{ $v->phone }}</td>
          <td><a class="button border-red" href="javascript:doDel({{ $v->id }})">移除</a></td>
        </tr>
        @endforeach
</table> 
         <!--分页显示-->
        {{ $list->appends($where)->links() }}
        <script type="text/javascript">
        function doDel(id)
           {
             if(confirm("你确定要移除吗？")){
             var form = document.myform;
             form.action = '/admin/orders/'+id;
             form.submit();
            }
         }
        </script>
   
@stop

